This invention generally relates to a technique for the generation of images on a display device, and more particularly to real-time computer simulation of visual images of perspective scenes such as landscapes and seascapes.
The principal application area for computer image generation has been that of visual training and/or entertainment simulators which present scenes to an operator, usually a trainee or game player, that allows the operator to practice some task such as flying an airplane, helicopter or space vehicle. In a flight simulator, a three-dimensional model of a desired xe2x80x9cgaming areaxe2x80x9d, called a visual data base, is prepared and stored in memory of a computer. Typically, the visual data base is an array of points, generally in the form of Cartesian coordinates. In visual data bases of this type, the z component associated with each x,y position may be an elevation value, or some other attribute required to produce a visually pleasing scene, such as color, hazing, viscosity, or the like.
In its usual configuration, the simulator combines an image generator, typically a computer, with a display device such as a cathode ray tube (CRT) or liquid crystal display (LCD). The image generator converts the three-dimensional visual data base into a two-dimensional scene for display on the display device. The generated imagery is meant to be representative of the true scenes that the operator would see if the operator were actually performing the task being simulated. The generation of display images is said to be in xe2x80x9creal timexe2x80x9d if the images are updated fast enough to provide the operator with a sense of motion.
Real-time generation of visual scenes is usually a compromise between realism and the cost of the image generator and the display device. Generation of visually pleasing and realistic appearing images requires the manipulation of substantial amounts of data by the image generator. This manipulation typically requires a high speed processor and a large amount of associated memory for storing both the raw data and the rendered image. In the past, various techniques have been employed to accelerate processing of the visual data during scene rendering, usually at the cost of reduced resolution and realism. Many prior techniques rendered the terrain of the gaming area using so-called polygonal projections. This type of visual scene rendering, while adequate for simple games, or for games where the focus of attention is not on the overall visual scene, lacks the realism important to providing the user with a true simulation of the operation of the aircraft or vehicle simulated even where the data comprising the polygonal projections is processed by a dedicated graphic accelerator card. Such realism is particularly important where the operator of the game is engaging in simulated combat, such as in a dog fight or tank battle. The simulation has two parts: 1) the operation model that simulates the actual operation of the plane or vehicle in response to operator inputs. For example, in a flight simulation, the operator must be presented with a flight model that mimics, as closely as possible, the actual flight characteristics of the plane being simulated. The flight model must present the operator with a realistic flying experience, mimicking the responses of the aircraft in a wide variety of situations.
Typically, a flight model must provide a realistic simulation of the aircraft""s response to changes such as operator inputs controlling climb, descent, banking for maneuvering, as well as determining whether the aircraft is in level flight or landing or taking off. While the processor is controlling the flight model, it must also associate the movements of the aircraft with motion over the ground. Thus, the processor must also render and update a visual scene representing a simulated xe2x80x9cworldxe2x80x9d that is experienced by he operator as the operator xe2x80x9cfliesxe2x80x9d the aircraft through the simulation.
Rendering a realistic visual scene at a rate that provides a visually pleasing and realistic experience places a heavy load on the processor. This, it is important to optimize the rendering of the scent to reduce processor load and data transmittal. In these simulations much of the action involves use of the features of the terrain, either for purpose of evasion or to lend difficulty to enemy detection and attack.
One prior approach forgoes the simplicity of polygonal feature rendering and uses a technique based on volume elements. In this approach, the visual data base contains elevational and color data associated with each point in an array of points defining a gaming area. The location of the operator in relation to the coordinates of the visual data base is determined from the operator""s starting position in the gaming area and the operator inputs. The terrain generator uses this information to divide the area of the visual scene visible to the operator into a number of cross-sections oriented perpendicular to the line of sight of the operator. The horizontal scale of the cross-sections changes proportionately to the distance from the operator, as does the vertical scale of the terrain features being displayed. The horizontally and vertically scaled visual scene is generated one cross-section at a time until the entire scene is rendered, and then displayed. Alternatively, each point on a series of individual cross-sections can be generated, stepping backwards or forwards through the cross-sections.
Additionally, game developers were constrained by the relatively slow processing speed of available processors incorporated in computers and gaming devices, slow data transfer rates across the internal bus of the computer or gaming device, and the amount of rapidly addressable random access memory available for storing the data comprising the visual image to be displayed. With the advent of 4x86 and other advanced processors, VESA and PCI bus architecture and the availability of inexpensive memory, developers are now able to utilize more sophisticated data retrieval and display techniques without sacrificing execution speed of the simulation.
Recently, dedicated hardware known as graphic accelerator cards have been developed for use with personal computer systems. These cards are designed to take much of the graphical processing load from the central processor of the system. Because they are designed to deal only with the type of data necessary to render graphical scenes, graphic accelerator cards are able to complete the mathematical processes necessary to render graphics from polygonal data sets much more rapidly than previous systems.
What has been needed is a technique for real-time generation of visual displays without sacrificing realism or requiring expensive hardware that utilizes the features of graphic accelerator cards to perform polygon calculations that also include the benefits inherent in rendering terrain data using voxels, or three dimensional position and elevational data.
The invention provides a unique real-time display of visual scenes rendered by a computer in accordance with programming commands to provide a realistic and visual pleasing simulation. The invention provides this real-time display of visual scenes by rendering the scenes by altering the scaling of the visual scenes in accordance with the distance of a virtual observer from features in the visual scene to be displayed. The present invention accomplishes the more realistic rendering of visual scenes by using elevational databases whose resolution is varied dependant upon the calculated distance of the observer to features that are to be displayed. The present invention then combines the rendered visual scene with textural information accessible by a graphic accelerator card to provide a highly detailed realistic three dimensional scene in real time.
In one embodiment, the present invention generates data representing a visual scene using a rendering engine designed to utilize a three dimensional database containing positional and elevational data. This data includes coordinate data establishing the location of each pixel in a visual scene, as well as data representing the distance of the pixel from an observer. This data is used to generate a set of vertexes and triangles that are used by a graphic accelerator card to apply a texture to the data and render the visual scene for display on a display device.
In another embodiment, the present invention provides a voxel generator for rendering a visual scene that outputs a vertex list directly to the accelerator card. The accelerator card then determines a list of triangles associated with the data in the vertex list and using the vertex list and triangle list, renders the visual scene for display on the display device.
In still another embodiment, the present invention includes a voxel generator, a vertex generator and a triangle generator. The vertex generator provides a list of vertices generated from data received from the voxel generator, and the triangle generator provides a list of triangles determined from the list of vertices and data from the voxel generator.
In a further embodiment, the present invention loads a color map into a buffer of the memory of an accelerator card, and generates a matrix of x and y coordinates for pixels to be displayed, and also stores an adjusted distance for each pixel from an observer in a Z-buffer. A vertex generator scans the rows of data contained in the Z-buffer to determine if there are any sudden changes or discontinuities indicating edges. If an edge is found, the generator creates a first screen vertex using the near screen position in the Z-buffer and a second screen vertex using the far screen position in the Z-buffer. These vertices are mapped onto the color map and stored in a vertex buffer. The generator then determines if there is sufficient slope between the vertices to create a contour vertex. If there is sufficient slope, the generator creates a contour vertex using the far screen position in the Z-buffer. This vertex is mapped onto the color map and stored in the vertex buffer. Once the entire screen has been scanned and vertices determined, a triangle generator scans the rows of the vertex buffer, comparing two adjacent rows of vertices at a time. As each pair of vertices is compared, the triangle generator determines a triangle connecting the vertices having the smallest change or slope of the diagonal, and stores the triangle in a triangle buffer. Once the entire vertex buffer has been scanned, the data contained in the vertex buffer and the triangle buffer are used to render the visual scene on a display device.
Other features and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, which illustrate, by way of example, the features of the invention.